﻿using System.Linq;
using System.Windows.Browser;

namespace mygestalt
{
	public partial class MainPage
	{
		public MainPage()
		{
			InitializeComponent();
			FindAndRunScript();
		}

		private void FindAndRunScript()
		{
			var scripts = HtmlPage.Document.GetElementsByTagName("script");
			var pythonScript = scripts.Where(x => x.GetProperty("type").ToString() == "python").First();
			PythonEngine.Run(pythonScript.GetProperty("innerHtml").ToString());
		}
	}
}